package minimips.isa.rtype;

import minimips.computer.Computer;

public class DsrlvInstruction extends RegisterWritingRTypeInstruction {

	public DsrlvInstruction(long memoryAddress, int rs,
			int rt, int rd, int extra) {
		super(memoryAddress, 0, "DSRLV", rs, rt, rd, extra, 22);
	}

	@Override
	protected int getDestinationRegister() {
		return this.getOpcode() >> 11 & 31;
	}

	@Override
	protected long executeAluOperation(Computer computer) {
		long rtLowerSixBits = computer.getId_ex_b().getRegisterValue() & 63;
		long dsrlvResult = computer.getId_ex_a().getRegisterValue() >> rtLowerSixBits;
		return dsrlvResult;
	}


}
